var webpack = require('webpack');
var path = require('path');
module.exports = {
	context:__dirname +'/src',
    entry:'./js/root.js',
    module:{
        loaders:[{
            test:/.jsx?$/,
            exclude:/(node_modules)/,
            loader:'babel-loader',
            query:{
                presets:['es2015','react'],
                plugins: [
                    ["import", 
	                    {
	                    	libraryName: "antd",
	                    	style: "css"
	                    }
                    ] //按需加载
                ]
            }
        },
        {  
		    test: /\.css$/,  
		    loader: 'style-loader!css-loader'  
		}  
        ]
    },
    output:{
        path:__dirname+'/src/',
        filename:'build.js',
    },
    plugins:[
	     new webpack.HotModuleReplacementPlugin()
	],
    devServer:{
        historyApiFallback:true,
        inline:true,
        hot:true,
        port:8888
    }
}
